import ajax from './ajax'

// http://localhost:3000/position/:geohash
// let BaseUrl = 'http://localhost:4000'
// http://localhost:3000/index_category

// 获取地址
export const resAddress = (geohash)=>ajax('/api/position/'+geohash)

// 获取分类商品
export const resCategory = ()=>ajax('/api/index_category')
// http://localhost:3000/shops?latitude=40.10038&longitude=116.36867

// 获取地址对应的商铺信息
export const resShops = (geohash)=>ajax('/api/shops',geohash)

// 获取短信验证码
export const reqSendCode = (phone)=>ajax('/api/sendcode',{phone})

// 账号密码登录
export const reqPwdLogin = (name, pwd, captcha) => ajax('/api/login_pwd', { name,pwd, captcha}, 'POST')

// 手机号短信验证码登录
export const reqSmsLogin = (phone, code) => ajax('/api/login_sms', {phone, code}, 'POST')

// 获取个人信息
export const reqUser = () => ajax('/api/userinfo')

// 请求登出
export const reqLogout = () => ajax('/api/logout')

/**
* 获取商家信息
*/
export const reqShopInfo = () => ajax('/info')


/**
* 获取商家评价数组
*/
export const reqShopRating = () => ajax('/ratings')


/**
* 获取商家商品数组
*/
export const reqShopGoods = () => ajax('/goods')